package com.cts.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import lombok.Data;

/**
 * 
 * @TableName blog
 */
@TableName(value ="blog")
@Data
public class Blog implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 文章标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 文章首图，用于随机文章展示
     */
    @TableField(value = "first_picture")
    private String firstPicture;

    /**
     * 文章正文
     */
    @TableField(value = "content")
    private String content;

    /**
     * 描述
     */
    @TableField(value = "description")
    private String description;

    /**
     * 公开或私密
     */
    @TableField(value = "is_published")
    private Boolean isPublished;

    /**
     * 推荐开关
     */
    @TableField(value = "is_recommend")
    private Boolean isRecommend;

    /**
     * 赞赏开关
     */
    @TableField(value = "is_appreciation")
    private Boolean isAppreciation;

    /**
     * 评论开关
     */
    @TableField(value = "is_comment_enabled")
    private Boolean isCommentEnabled;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 浏览次数
     */
    @TableField(value = "views")
    private Integer views;

    /**
     * 文章字数
     */
    @TableField(value = "words")
    private Integer words;

    /**
     * 阅读时长(分钟)
     */
    @TableField(value = "read_time")
    private Integer readTime;

    /**
     * 文章分类
     */
    @TableField(value = "category_id")
    private Long categoryId;

    /**
     * 文章分类名称
     */
    @TableField(exist = false)
    private String categoryName;

    /**
     * 是否置顶
     */
    @TableField(value = "is_top")
    private Boolean isTop;

    /**
     * 密码保护
     */
    @TableField(value = "password")
    private String password;

    /**
     * 可见性
     */
    @TableField(value = "visible_model")
    private String visibleModel;

    /**
     * 文章作者
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 标签
     */
    @TableField(exist = false)
    private Long[] tagList;

    /**
     * 标签
     */
    @TableField(exist = false)
    private List<Tag> tags;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}